package com.google.code.easyparking.controleur;

import javax.swing.JOptionPane;

public class ControleurCamera {

	public double readDouble(String message) {
		Double value = null;

		do {
			try {
				String s = (String) JOptionPane.showInputDialog(null, message,
						message, JOptionPane.PLAIN_MESSAGE);

				value = Double.parseDouble(s);
			} catch (NumberFormatException ex) {

			}
		} while (value == null);
		return value;
	}

	public String getImmat() {
		String s = null;
		do {
			s = (String) JOptionPane.showInputDialog(null,
					"Plaque d'immatriculation", "Plaque d'immatriculation",
					JOptionPane.PLAIN_MESSAGE);
		} while (s == null);
		return s;
	}

	public double getLongeur() {
		return readDouble("Longeur : ");
	}

	public double getHauteur() {
		return readDouble("Hauteur : ");
	}
}
